Terraform Local-Exec Provisioner: Run Local Commands/Scripts During Resource Creation/Destruction

youtube
Terraform Local-Exec Provisioner: Run Local Commands/Scripts During Resource Creation/Destruction Welcome to your essential 2025 guide to the Terraform local-exec provisioner! Do you need to run a command or execute a script on the same machine where you are running terraform apply or terraform destroy, triggered by the creation or destruction of a resource? The local-exec provisioner is designed for precisely this scenario, allowing you to invoke local processes as part of your Terraform workflow. This comprehensive tutorial, useful for any Terraform user regardless of the cloud provider (AWS, Azure, GCP), will provide a clear, step-by-step walkthrough of how to use this provisioner. We will explain its core purpose – executing commands locally, not on the remote resource itself – and demonstrate its syntax (provisioner "local-exec" {}). You will learn about its key arguments: command: The command string to execute on your local machine. This command can use attributes from the resource it's attached to (e.g., passing an IP address to a local script). interpreter: Specifies the interpreter to use for the command (e.g., ["/bin/bash", "-c"] for Bash scripts). working_dir: The directory on your local machine from which to run the command. when: Controls whether the provisioner runs during resource creation (create - the default) or destruction (destroy). We will provide practical examples, demonstrating how local-exec could be used to: Run a local script (./configure-dns.sh) after an aws_instance is created, passing the instance's public IP address as an argument. T
  2025/10/24      youtube

Our Tag

最近投稿されたプログラミング学習動画

How to negotiate your salary like a pro using anchoring

When you're negotiating your salary for ...

  2025/12/06

Exploring Quantum Computing & Python Frameworks | Real Python Podcast

python

What are recent advances in the field of...

  2025/12/05

How to build your own learning path using Open Source with Kunal Kushw

study

Today Quincy Larson interviews Kunal Kus...

  2025/12/05

The "this" keyword can be tricky. Ania helps you sort out one of its q

Arrow functions don't have their own 'th...

  2025/12/05

【誤解→DXは一度やれば終わり】その理由と失敗事例・成功事例【DX実践講座06】

【キノクエストforBizサービス内容について】 ✅キノコードの動画を商用利用...

  2025/12/05

Introduction to pandas

pandas
python

Download your free Python Cheat Sheet he...

  2025/12/04

Profiling Pytorch/XLA on TPUs with XProf

Unlock the full potential of your PyTorc...

  2025/12/04

Git & GitHub Crash Course for Beginners [2026]

github

Learn Git and GitHub from scratch with c...

  2025/12/04

Learning to code on the job - right in the browser

study

freeCodeCamp runs right in the browser -...

  2025/12/04

Optimizing Flax NNX Models with Optax (Part 2)

This is part two of our two episode seri...

  2025/12/04

NumPy & JAX NumPy (Part 2)

In this second video of our two-part ser...

  2025/12/04

Scaling Up (Part 1)

In part one of this three part series on...

  2025/12/04

Getting started with MNIST

Now that you’ve learned the basic concep...

  2025/12/04

Scaling Up (Part 2)

Welcome back to part two of our three pa...

  2025/12/04

Building a Flutter widget gallery with Gemini 3

flutter

See how Gemini 3 writes code and builds ...

  2025/12/04

How Anthropic Targeted IDEs to Win Over Developers

python

Download your free Python Cheat Sheet he...

  2025/12/03